public class test {
    public static void main(String[] args) {
        String str1 = "name=hyf age=24";
        String[] strings = str1.split(" ");// 将字符串以&为界划分为2组
        for (int i = 0; i < strings.length; i++) {
            System.out.println(strings[i]);

//            String[] strings1 = strings[i].split("=");//将字符串以=为界划分
//            for (int j = 0; j < strings1.length; j++) {
//                System.out.println(strings1[j]);
            }
        }
    }

